package net.mysoft.budgetsoft.system.enumtype;

public enum OrgTypeEnum {
	
	MANAGE(1, "经营部门"),
	FUNCTION(2, "职能部门");
	
	private int code;
	private String desc;
	private OrgTypeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public OrgTypeEnum getEnumByCode(int code) {
		OrgTypeEnum[] enums = OrgTypeEnum.values();
		for(OrgTypeEnum enumtype:enums) {
			if(code==enumtype.getCode()) {
				return enumtype;
			}
		}
		return null;
	}

}
